<?php
/*************************************************
推手h合作平台模型 - the 
Author: WangHuabin <17-8-24>

*************************************************/
namespace Home\Model;
use Think\Model\RelationModel;
class RecommendPlatformModel extends RelationModel {
    //查询多条数据
    public function get_all($map,$field="*",$page=0,$pagenum=9999999){
        $data = $this->where($map)->field($field)->limit($page,$pagenum)->select();
        return $data;
    }    

    //查询单数据
    public function get_one($map){
        $data = $this->where($map)->find();
        return $data;
    }

    //更新
    public function edit($map,$data){
        $r = $this->where($map)->save($data);
        return $r;
    }

    //添加
    public function add($data){
        $data =M('RecommendPlatform')->data($data)->add();
        return $data;
    }

    //统计
    public function count($map){
        $count =M('RecommendPlatform')->where($map)->count();
        return $count;
    }

    

}